package com.shengdou.as.slopsapptest.utils;

import android.content.Context;

/**
 * Created by Think on 2016/10/22.
 * 访问网络地址的常量类
 */
public class NetConstant {
    /**
     * 上下文对象
     */
    private static Context context;

    public static void setContext(Context context) {
        NetConstant.context = context;
    }

    /**
     * 主机地址
     */
//    public static String SERVICE = "http://192.168.0.8/sewage/public/app";
    //    public static String SERVICES = "http://192.168.0.8/sewage/";
//    public static String SERVICE = "http://test.wushui.sundaytek.com/app";
//    public static String SERVICES = "http://test.wushui.sundaytek.com/";
//    public static String SERVICE = "http://wushui.sundaytek.com/app";
//    public static String SERVICES = "http://wushui.sundaytek.com/";
//    public static String SERVICESPUBLIC = "http://192.168.1.114/sewage/public";
    public static String SERVICESPUBLIC = "http://wushui.sundaytek.com";
    /**
     * 获取厂家信息
     * factoryadd
     */
    public static String FACTORYADD = SERVICESPUBLIC + "/service/Disperse/app_face_addr";
    /**
     * 故障保修
     */
    public static String STOPGUARANTEE = SERVICESPUBLIC + "/service/Disperse/fault";
    /**
     * 版本更新
     */
    public static String VERSION = SERVICESPUBLIC + "/service/Disperse/version";
    /**
     * 故障列表
     */
    public static String FAILURELIST = SERVICESPUBLIC + "/service/disperse/my_fault";
    /**
     * 联系我们
     */
    public static String CONTACTUS = SERVICESPUBLIC + "/service/Disperse/callus";
    /**
     * 关于我们
     */
    public static String ABOUTMINE = SERVICESPUBLIC + "/service/Disperse/ws_aboutus";
    public static String ip;

    public static String SERVICES() {
        return SharedPreferenceUtil.getPreferenceString(context, "ipInfo") + "/";
    }

    ;

    public static String ip() {
        NetConstant.ip = SharedPreferenceUtil.getPreferenceString(context, "ipInfo");
        LogUtil.e("==========", NetConstant.ip + "------" + SharedPreferenceUtil.getPreferenceString(context, "ipInfo"));
        return NetConstant.ip + "/app";
    }

    /**
     * 获取验证码
     * imageServlet
     */
    public static String IMAGESERVLET() {
        return ip() + "/account/sendSms";
    }

    /**
     * 登录
     */
    public static String LOGIN() {
        return ip() + "/account/smsLogin";
    }

    /**
     * 用户信息
     */
    public static String USERINFO() {
        return ip() + "/user/info";
    }

    /**
     * 获取厂名
     * imageServlet
     */
    public static String SETFACTORY() {
        return ip() + "/account/chgfactory";
    }

    /**
     * 退出登录
     */
    public static String LOGINOUT() {
        return ip() + "/account/loginout";
    }

    /**
     * 添加管理员
     */
    public static String USERADD() {
        return ip() + "/user/add";
    }

    /**
     * 编辑管理
     */
    public static String USEREDIT() {
        return ip() + "/user/edit";
    }

    /**
     * 管理列表
     */
    public static String USERLIST() {
        return ip() + "/user/lists";
    }

    /**
     * 删除管理
     */
    public static String USERDEL() {
        return ip() + "/user/del";
    }

    /**
     * 水池列表
     */
    public static String POOLLIST() {
        return ip() + "/factory/pools";
    }

    /**
     * 泥位高度
     */
    public static String POOLPUSH() {
        return ip() + "/pushing/testpools";
    }

    /**
     * 报警记录列表
     */
    public static String ALARMLIST() {
        return ip() + "/record/alarm";
    }

    /**
     * 24小时历史泥位
     */
    public static String POOLDAY() {
        return ip() + "/record/day_data";
    }

    /**
     * 一周历史泥位
     */
    public static String POOLWEEK() {
        return ip() + "/record/week_data";
    }

    /**
     * 头像上传
     */
    public static String PICTUREUPLOAD() {
        return ip() + "/user/upload_pirtraut";
    }

    /**
     * 故障列表
     */
    public static String FAILURELIST() {
        return ip() + "/user/fault";
    }

    /**
     * 单水池实时数据接口
     */
    public static String SINGLETIME() {
        return ip() + "/pushing/testtimely";
    }

    /**
     * 设备操作
     */
    public static String SENSOR() {
        return ip() + "/factory/rinse";
    }
}

